<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Cookieclass
 *
 * @author hzq
 */
class myCookies {

    private static $obj;
    public $_cookiePiex;

    function __construct($cookiePath='/', $domain='', $_cookPiex="___d__") {


        $this->_cookiePiex = $_cookPiex;
        $this->cookiePath = $cookiePath;
        $this->domain = $domain != '' ? $domain : $_SERVER['HTTP_HOST'];
    }

    function set($key, $value, $expire=3600) {

        setcookie($this->_cookiePiex . $key, $value, time() + $expire, $this->cookiePath, $this->domain);
    }

    function get($key) {

        return $_COOKIE[$this->_cookiePiex . $key];
    }

}

?>
